//
//  BookManager.m
//  03-HomeWork
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BookManager.h"
@implementation BookManager
- (NSMutableArray *)addBooks:(Book *)book {
    [self.bookArray addObject:book];
    return _bookArray;
}
- (NSMutableArray *)dele:(Book *)book {
    [self.bookArray removeObject:book];
    return _bookArray;
}

- (void)modi:(NSString *)name withPrice:(NSInteger)price {
    BOOL isFind = NO;
    for (Book *book in self.bookArray) {
        if ([book.bookName isEqualToString:name]) {
            book.price = price;
            isFind = YES;
        }
    }
    if (isFind) {
        NSLog(@"找到这本书,价格已改");
    } else {
        NSLog(@",没有找到这本书");
    }
}

- (void)show {
    for (Book *book in self.bookArray) {
        NSLog(@"bookName = %@",book.bookName);
        }
}
@end
